#include <bits/stdc++.h>
using namespace std;
int n,a[1000005],sum,pos=0;
int b[1000005];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    sum=n;
    for (int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    b[0]=0;
    for (int i=1;i<=n;i++)
    {
        if(a[i]!=a[i-1])
        {

            pos++;
        }
        b[pos]++;
    }
    for (int i=1;i<pos;++i)
    {
        if(b[i+1]>=b[i])
        {
            sum-=b[i];
        }

        else
        {
            sum-=b[i+1];
        }
    }
    cout<<sum;
    return 0;
}
